<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			var num=prompt("请输入一个数字","1");
			if(isNaN(num)){
				alert("输入错误");
			}else{
				var a=parseInt(num);
				alert(a);
			}
			
		</script>
	</head>
	<body>
	</body>
</html>
